package demo3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 何华树
 * Date: 2024-09-10
 * Time: 20:30
 */
public class Test {
    public static void eat_func(Animal animal) {
        animal.eat();
    }
    public static void run_func(IRunning iRunning) {
        iRunning.run();
    }
    public static void swim_func(ISwimming iSwimming) {
        iSwimming.swim();
    }
    public static void fly_func(IFly iFly) {
        iFly.fly();
    }
    public static void main1(String[] args) {

        Dog dog = new Dog("旺财",4);
        dog.eat();
        dog.run();
        dog.swim();

        Cat cat = new Cat("小虎",4);
        cat.eat();
        cat.run();
        cat.swim();

        Bird bird = new Bird("小彩",6);
        bird.eat();
        bird.fly();

    }
}
